<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="../common.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   <link href="../CSS/style.css" rel="stylesheet">
<%request.setCharacterEncoding("utf-8");
String manager=request.getParameter("manager");//此处必须进行编码转换，否则输入中文用户名时将出现乱码
try{
        java.util.Collection l = bookDB.getManageName(manager);
                java.util.Iterator i = l.iterator();
                Manager bt=null;
	     while(i.hasNext()){
                    bt = (Manager) i.next();

                    String PWD = request.getParameter("PWD");
                    if (PWD.equals(bt.getPwd())) {
                      session.setAttribute("manager",manager);
			response.sendRedirect("index.jsp");
                    } else {
                      out.println("<script language='javascript'>alert('您输入的管理员或密码错误!');window.location.href='Login_M.jsp';</script>");
                    }
                } 
}catch(Exception e){
out.println("<script language='javascript'>alert('您的操作有误!');window.location.href='Login_M.jsp';</script>");
}
%>

